From: David Härdeman Date: Wed, 15 Oct 2025 16:43:03 +0000 (+0200) Subject: luci-mod-network: organize "limits" tab in dhcp/dns views X-Git-Url: http://git.openwrt.org/%22https:/collectd.org/%22http:/www.crowdsec.net//%22https%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22https%22?a=commitdiff_plain;h=8a502e175510ae3e4c72e66393ce7e41268f7bdd;p=project%2Fluci.git luci-mod-network: organize "limits" tab in dhcp/dns views Sort the options in the "limits" tab so that they are all grouped together in the order they appear in the UI and delete ones that are specific to DNS from dhcp.js and vice versa. Only one option is relevant to the dhcp view, so move it to the "general" tab. Signed-off-by: David Härdeman --- diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js index 2c227592ce..4f915c2661 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js @@ -391,7 +391,6 @@ return view.extend({ s.tab('general', _('General')); s.tab('devices', _('Devices & Ports')); - s.tab('limits', _('Limits')); s.tab('logging', _('Log')); s.tab('files', _('Resolv & Hosts Files')); s.tab('leases', _('Static Leases')); @@ -412,6 +411,13 @@ return view.extend({ _('Allocate IPs sequentially'), _('Allocate IP addresses sequentially, starting from the lowest available address.')); o.optional = true; + + o = s.taboption('general', form.Value, 'dhcpleasemax', + _('Max. DHCP leases'), + _('Maximum allowed number of active DHCP leases.')); + o.optional = true; + o.datatype = 'uinteger'; + o.placeholder = 150; // End general // Begin devices @@ -585,47 +591,6 @@ return view.extend({ o.optional = true; o.depends('logdhcp', '0'); - o = s.taboption('limits', form.Value, 'dhcpleasemax', - _('Max. DHCP leases'), - _('Maximum allowed number of active DHCP leases.')); - o.optional = true; - o.datatype = 'uinteger'; - o.placeholder = 150; - - o = s.taboption('limits', form.Value, 'ednspacket_max', - _('Max. EDNS0 packet size'), - _('Maximum allowed size of EDNS0 UDP packets.')); - o.optional = true; - o.datatype = 'uinteger'; - o.placeholder = 1280; - - o = s.taboption('limits', form.Value, 'dnsforwardmax', - _('Max. concurrent queries'), - _('Maximum allowed number of concurrent DNS queries.')); - o.optional = true; - o.datatype = 'uinteger'; - o.placeholder = 150; - - o = s.taboption('limits', form.Value, 'cachesize', - _('Size of DNS query cache'), - _('Number of cached DNS entries, 10000 is maximum, 0 is no caching.')); - o.optional = true; - o.datatype = 'range(0,10000)'; - o.placeholder = 150; - - o = s.taboption('limits', form.Value, 'min_cache_ttl', - _('Min cache TTL'), - _('Extend short TTL values to the seconds value given when caching them. Use with caution.') + - _(' (Max 1h == 3600)')); - o.optional = true; - o.placeholder = 60; - - o = s.taboption('limits', form.Value, 'max_cache_ttl', - _('Max cache TTL'), - _('Set a maximum seconds TTL value for entries in the cache.')); - o.optional = true; - o.placeholder = 3600; - o = s.taboption('pxe_tftp', form.Flag, 'enable_tftp', _('Enable TFTP server'), _('Enable the built-in single-instance TFTP server.')); diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dns.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dns.js index 079fa1e274..659a8242f7 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dns.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dns.js @@ -918,6 +918,41 @@ return view.extend({ _('Remove any subnet address already present in a downstream query before forwarding it upstream.')); // End forward + // Begin limits + o = s.taboption('limits', form.Value, 'ednspacket_max', + _('Max. EDNS0 packet size'), + _('Maximum allowed size of EDNS0 UDP packets.')); + o.optional = true; + o.datatype = 'uinteger'; + o.placeholder = 1280; + + o = s.taboption('limits', form.Value, 'dnsforwardmax', + _('Max. concurrent queries'), + _('Maximum allowed number of concurrent DNS queries.')); + o.optional = true; + o.datatype = 'uinteger'; + o.placeholder = 150; + + o = s.taboption('limits', form.Value, 'cachesize', + _('Size of DNS query cache'), + _('Number of cached DNS entries, 10000 is maximum, 0 is no caching.')); + o.optional = true; + o.datatype = 'range(0,10000)'; + o.placeholder = 150; + + o = s.taboption('limits', form.Value, 'min_cache_ttl', + _('Min cache TTL'), + _('Extend short TTL values to the seconds value given when caching them. Use with caution.') + + _(' (Max 1h == 3600)')); + o.optional = true; + o.placeholder = 60; + + o = s.taboption('limits', form.Value, 'max_cache_ttl', + _('Max cache TTL'), + _('Set a maximum seconds TTL value for entries in the cache.')); + o.optional = true; + o.placeholder = 3600; + // End limits o = s.taboption('logging', form.Flag, 'logqueries', _('Log queries'), @@ -1068,47 +1103,6 @@ return view.extend({ o.optional = true; o.depends('logdhcp', '0'); - o = s.taboption('limits', form.Value, 'dhcpleasemax', - _('Max. DHCP leases'), - _('Maximum allowed number of active DHCP leases.')); - o.optional = true; - o.datatype = 'uinteger'; - o.placeholder = 150; - - o = s.taboption('limits', form.Value, 'ednspacket_max', - _('Max. EDNS0 packet size'), - _('Maximum allowed size of EDNS0 UDP packets.')); - o.optional = true; - o.datatype = 'uinteger'; - o.placeholder = 1280; - - o = s.taboption('limits', form.Value, 'dnsforwardmax', - _('Max. concurrent queries'), - _('Maximum allowed number of concurrent DNS queries.')); - o.optional = true; - o.datatype = 'uinteger'; - o.placeholder = 150; - - o = s.taboption('limits', form.Value, 'cachesize', - _('Size of DNS query cache'), - _('Number of cached DNS entries, 10000 is maximum, 0 is no caching.')); - o.optional = true; - o.datatype = 'range(0,10000)'; - o.placeholder = 150; - - o = s.taboption('limits', form.Value, 'min_cache_ttl', - _('Min cache TTL'), - _('Extend short TTL values to the seconds value given when caching them. Use with caution.') + - _(' (Max 1h == 3600)')); - o.optional = true; - o.placeholder = 60; - - o = s.taboption('limits', form.Value, 'max_cache_ttl', - _('Max cache TTL'), - _('Set a maximum seconds TTL value for entries in the cache.')); - o.optional = true; - o.placeholder = 3600; - o = s.taboption('pxe_tftp', form.Flag, 'enable_tftp', _('Enable TFTP server'), _('Enable the built-in single-instance TFTP server.'));